﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Display.aswingui.buttonui {
    import flash.events.*;
    import flash.geom.*;
    import org.aswing.*;
    import org.aswing.event.*;
    import Modules.guide.ui.*;
    import org.aswing.plaf.basic.*;
    import L10n.*;

    public class BasicCashButtonUI extends BasicButtonUI {

        public static var m_cashCannotUseTooltip:CashCannotUseTooltip;

        override public function installUI(_arg1:Component):void{
            button = AbstractButton(_arg1);
            installDefaults(button);
            installComponents(button);
            this.installListeners(button);
            if (!LocaleHelper.localSetting.sns.cash_enable){
                button.setText("??? ");
            };
        }
        override protected function getTextPaintColor(_arg1:AbstractButton):ASColor{
            if (!LocaleHelper.localSetting.sns.cash_enable){
                button.setEnabled(false);
                button.mouseEnabled = true;
            };
            return (super.getTextPaintColor(_arg1));
        }
        override protected function installListeners(_arg1:AbstractButton):void{
            _arg1.addStateListener(this.__stateListener);
            if (LocaleHelper.localSetting.sns.cash_enable){
                return;
            };
            _arg1.addEventListener(MouseEvent.ROLL_OVER, this.onRollOverCashButton);
            _arg1.addEventListener(MouseEvent.ROLL_OUT, this.onRollOutCashButton);
        }
        override protected function uninstallListeners(_arg1:AbstractButton):void{
            _arg1.addStateListener(this.__stateListener);
            if (LocaleHelper.localSetting.sns.cash_enable){
                return;
            };
            _arg1.removeEventListener(MouseEvent.ROLL_OVER, this.onRollOverCashButton);
            _arg1.removeEventListener(MouseEvent.ROLL_OUT, this.onRollOutCashButton);
        }
        private function onRollOverCashButton(_arg1:MouseEvent):void{
            if (m_cashCannotUseTooltip == null){
                m_cashCannotUseTooltip = new CashCannotUseTooltip();
            };
            var _local2:Point = getTextField().localToGlobal(new Point(getTextField().x, getTextField().y));
            m_cashCannotUseTooltip.x = (_local2.x - 108);
            m_cashCannotUseTooltip.y = ((_local2.y - m_cashCannotUseTooltip.height) - 4);
            Global.stage.addChild(m_cashCannotUseTooltip);
        }
        private function onRollOutCashButton(_arg1:MouseEvent):void{
            if (((m_cashCannotUseTooltip) && (m_cashCannotUseTooltip.parent))){
                m_cashCannotUseTooltip.parent.removeChild(m_cashCannotUseTooltip);
            };
        }
        private function __stateListener(_arg1:AWEvent):void{
            button.repaint();
        }

    }
}//package Display.aswingui.buttonui 
